package com.rede.didiok.user.modulelist.rank.service.impl;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rede.didiok.common.utils.PageUtils;
import com.rede.didiok.common.utils.Query;
import com.rede.didiok.user.modulelist.rank.dao.AttrInfoDao;
import com.rede.didiok.user.modulelist.rank.entity.AttrInfoEntity;
import com.rede.didiok.user.modulelist.rank.service.AttrInfoService;


@Service("attrInfoService")
public class AttrInfoServiceImpl extends ServiceImpl<AttrInfoDao, AttrInfoEntity> implements AttrInfoService {

    @Resource
    private AttrInfoDao attrInfoDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<AttrInfoEntity> page = this.page(
                new Query<AttrInfoEntity>().getPage(params),
                new QueryWrapper<AttrInfoEntity>()
        );

        return new PageUtils(page);
    }

    /**
     * 根据 memberUid 删除 attrInfo
     *
     * @param memberUid
     * @param status
     * @return
     */
    @Override
    public Boolean updateStatusByMemberUid(String memberUid, int status) {
        return attrInfoDao.updateStatusByMemberUid(memberUid, status);
    }

}